<template>
  <div style="" class="mx-content">
    
  </div>
</template>

<script>
export default {
  data() {
    return {
      details: {},
      list: [],
      id: null,
    };
  },

  components: {},
  props: {},
  mounted() {
    window.scroll(0, 0);
    this.$store.dispatch("other/setIndex", 4);
    let id = this.$route.query.id;
    this.id = id;
    this.getDetails(id);
    this.getList();
  },
  computed: {
    cList: function () {
      let list = this.list;
      let cList = [];
      list.forEach((v) => {
        if (v.id != this.id) {
          cList.push(v);
        }
      });
      return cList;
    },
  },
  watch: {},
  methods: {
    getDetails(id) {
      let self = this;
      job_detail({ jobId: id }).then((res) => {
        self.details = res.data;
      });
    },
    getList() {
      let self = this;
      job_list({ page: 1, limit: 5 }).then((res) => {
        self.list = res.data.records;
      });
    },
    handleToWork(it) {
      this.$router.push({ path: "/work", query: { id: it.id } });
      this.id = it.id;
      this.getDetails(it.id);
      window.scroll(0, 0);
    },
  },
  destroyed() {},
};
</script>
<style lang='scss' scoped>
@import "@/style/variables.scss";

.work-content-wrap {
  padding-top: 48px;
  min-height: calc(100vh - 460px);
  .work-content {
    width: 70%;
    .work-title {
      padding-bottom: 10px;
      border-bottom: 1px solid $modal;
      .work-name {
        font-size: $fsH2;
        margin-bottom: 16px;
      }
      .work-subtitle {
        font-size: 12px;
        i {
          font-size: 16px;
          margin: 0 12px;
        }
        span {
          padding: 0 12px 0 8px;
        }
        .boforeLine {
          position: relative;
          &::before {
            content: "";
            position: absolute;
            top: 2px;
            right: 0;
            bottom: 2px;
            width: 1px;
            background-color: $span;
          }
        }
        // &:first-child(span){
        //         padding-left: 15px;
        //     }
      }
    }
    .work-text {
      padding: 24px 0;
      color: $p !important;
    }
  }
  .work-hot {
    width: 30%;
    padding-left: 48px;
    .work-hot-title {
      line-height: 24px;
      font-size: $fsH5;
      margin: 0;
      padding-bottom: 24px;
      border-bottom: 1px solid $modal;
    }
    .work-hot-content {
      padding: 24px 0;
      ul {
        li {
          img {
            width: 102px;
            height: 64px;
          }
          .hot-right {
            margin-left: 16px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
          }
        }
      }
    }
  }
}
.job-wrap {
  .job-item {
    padding: 32px;
    margin-bottom: 24px;
    border-radius: 8px;
    background-color: $modal;
    cursor: pointer;
    &:nth-child(3n) {
      margin-right: 0;
    }
    .item-title {
      display: flex;
      justify-content: space-between;
      .job-name {
        color: $h;
      }
    }
    .item-body {
      margin-top: 16px;
      color: $span;
      span {
        padding: 0 8px 0 4px;
        &:first-child {
          padding-left: 0;
        }
      }
      .boforeLine {
        position: relative;
        &::before {
          content: "";
          position: absolute;
          top: 2px;
          right: 0;
          bottom: 2px;
          width: 1px;
          background-color: $span;
        }
      }
    }
    &:hover {
      .job-name {
        color: $primary;
      }
    }
  }
}

@media screen and (max-width: 768px) {
  .work-content-wrap {
    flex-direction: column;
    padding-top: 0;
    .work-content {
      width: 100%;
      .work-title {
        .work-name {
          font-size: 0.48rem;
        }
        .work-subtitle {
          font-size: 0.32rem;
          i {
            margin: 0 0.2rem;
          }
        }
      }

      .work-text {
        padding: 0.42rem 0 0.8rem;
      }
    }
    .work-hot {
      width: 100%;
      padding-left: 0;
      .work-hot-title {
        padding-bottom: 0.42rem;
      }
      .job-wrap {
        .job-item {
          margin-bottom: 0.32rem;
        }
      }
    }
  }
}
</style>